﻿<%@ Page Language="C#" MasterPageFile="~/Org/MasterPage.master" AutoEventWireup="true" CodeFile="frmO_EmpDiplomaInput.aspx.cs" Inherits="Org_frmO_EmpDiplomaInput" Title="保有資格情報登録" Culture="ja-JP" uiCulture="ja" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
保有資格情報登録

 <script id="ConvertType" type="text/C#" runat="server">
    public string ConvertType(object flag)
    {
        string result = "";
        result = flag.ToString();
        if (result == "")
            return result;
        
        result = flag.Equals(Boolean.Parse("True")) ? "社外" : "社内";
        return result;
    }
</script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/javascript" src="../Js/jquery.min.js"></script>
<script src="../js/jquery.blockUI.js" type="text/javascript"></script>
<script src="../js/Validation.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">

	$(document).ready(function() {
		aReady();
	});

	function aReady() {
		disableControlOnLoadUpdatePanel("", "");
		
		$('#ctl00_ContentPlaceHolder1_ddl_資格免許').focus();

		registerControlToValidation("validation");

		formatDate("css_textbox_Calendar", "/");

		registerEnterEvent("css_font_textbox", "<%= btn登録.ClientID %>", 4);
	}

    function CheckDate受検年月日(oSrc, args) {
        if (args.Value != "") {
        	var Valid = checkDate(args.Value);
        	if (Valid == true) {
        		args.IsValid = checkYearOld(args.Value, getNowDate(new Date()), 0, "<");
        	}
        	ValidatorEnable2(document.getElementById("<%= CustomValidator受検年月日1.ClientID %>"), true);
        }
        ValidatorEnable2(document.getElementById("<%= CustomValidator取得年月日.ClientID %>"), true);
    }

    function CheckIsDate受検年月日(oSrc, args) {
        if (args.Value != "") {
            args.IsValid = checkDate(args.Value);
        }
    }

    function CheckIsDate取得年月日(oSrc, args) {
        if (args.Value != "") {
            args.IsValid = checkDate(args.Value);
        }
    }

    function CheckDate取得年月日(oSrc, args) {
    	if (args.Value != "") {
    		var Valid = checkDate(args.Value);
    		if (Valid == true) {
    			args.IsValid = checkYearOld($('#ctl00_ContentPlaceHolder1_txt_受検年月日').val(), args.Value, 0, "<");
    		}
    		ValidatorEnable2(document.getElementById("<%= CustomValidator取得年月日1.ClientID %>"), true);
    	}
    }

    function CheckDate取得年月日2(oSrc, args) {
    	if (args.Value != "") {
    		var Valid = checkDate(args.Value);
    		if (Valid == true) {
    			args.IsValid = checkYearOld(args.Value, getNowDate(new Date()), 0, "<");
    		}
    		ValidatorEnable2(document.getElementById("<%= CustomValidator取得年月日1.ClientID %>"), true);
    	}
    	ValidatorEnable2(document.getElementById("<%= CustomValidator受検年月日.ClientID %>"), true);
    }
</script>
<style type="text/css">
    .css_font_textbox
    {
    	font-family: MS UI Gothic;
        font-size: 11pt;
    }
    .invalid
    {
        background-color: #E6EDCC;
    }
    .visible
    {
        display: none;
    }
    .grv_name
    {
    	color: buttonshadow;
    }
    #div_保有資格情報一覧
    {
    	padding: 0 0 20px 22px;
    }
    .btn_next 
    {
		width: 510px;
	}
</style>
<div class="maindiv1">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
    <asp:AsyncPostBackTrigger ControlID="btn登録" />
</Triggers>
<ContentTemplate>
        <div class="Header1">
            <span>＊: 必須</span>
        </div>
        
        <div class="NoteStyle">
        <span>
        ※下記の情報があれば、必須項目を入力してください。なければ、次ボタンを押してください。
        </span>
        </div>
        <div>&nbsp;</div>
        
        <div class="detail-admin-row">
            <span class="detail-admin-label">資格免許 :</span>
            <asp:DropDownList ID="ddl_資格免許" runat="server"
                CssClass="css_font_textbox dropdownlist width2 validation">
            <asp:ListItem Value="-1" selected="true">[選択]</asp:ListItem>
            </asp:DropDownList>
            <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator資格免許"
                    ControlToValidate="ddl_資格免許"
                    Display="None"
                    InitialValue = "-1"
                    SetFocusOnError="False"
                    ErrorMessage="資格免許: を入力してください。" />
                 <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender25"
                    TargetControlID="RequiredFieldValidator資格免許" 
                    HighlightCssClass="invalid" Width="240px"
                    CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
           <span class="required-field">&nbsp*</span>
        </div>       
        <div class="detail-admin-row">
            <span class="detail-admin-label">社内外区分 :</span> 
            <asp:DropDownList ID="ddl_社内外区分" runat="server"
                CssClass="css_font_textbox dropdownlist width2 validation">
            <asp:ListItem Value="-1" selected="true">[選択]</asp:ListItem>
             </asp:DropDownList>
             <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator社内外区分"
                    ControlToValidate="ddl_社内外区分"
                    Display="None"
                    InitialValue = "-1"
                    SetFocusOnError="False"
                    ErrorMessage="社内外区分: を入力してください。" />
                 <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender3"
                    TargetControlID="RequiredFieldValidator社内外区分" 
                    HighlightCssClass="invalid" Width="240px"
                    CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
           <span class="required-field">&nbsp*</span>
        </div>
        <div class="detail-admin-row">
            <span class="detail-admin-label">受検年月日 :</span>
            <asp:TextBox ID="txt_受検年月日" runat="server" onkeypress="return InputNumberKeys(this, event)"
                CssClass="css_font_textbox css_textbox_Calendar validation textbox width_calendar" MaxLength="8"/>
            <asp:ImageButton ID="ImageButton1" runat="server" CssClass="btn_calendar"  ImageUrl="~/Images/calendar.jpg" ValidationGroup="detailForm"/>
            <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" PopupButtonID="ImageButton1" TargetControlID="txt_受検年月日" Format="yyyy/MM/dd"> </ajaxToolkit:CalendarExtender>    
             <asp:CustomValidator ID= "CustomValidator受検年月日" runat="server" 
                    ControlToValidate="txt_受検年月日" 
                    ClientValidationFunction= "CheckDate受検年月日"
                    ErrorMessage="1.0" 
                    Display ="None" 
                    SetFocusOnError="False" ValidateEmptyText="True" />
                <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender1"
                    TargetControlID="CustomValidator受検年月日" 
                    HighlightCssClass="invalid" Width="240px"
                    CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
                <asp:CustomValidator ID= "CustomValidator受検年月日1" runat="server" 
                    ControlToValidate="txt_受検年月日" 
                    ClientValidationFunction= "CheckIsDate受検年月日"
                    ErrorMessage="1.1" 
                    Display ="None" 
                    SetFocusOnError="False" ValidateEmptyText="True" />
                <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender18"
                    TargetControlID="CustomValidator受検年月日1" 
                    HighlightCssClass="invalid1" Width="210px"
                    CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
                <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator受検年月日"
                    ControlToValidate="txt_受検年月日"
                    Display="None"
                    ErrorMessage="1.2" 
                    SetFocusOnError="False" />
                <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender19"
                        TargetControlID="RequiredFieldValidator受検年月日" 
                        HighlightCssClass="invalid2" Width="240px"
                        CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png"/>
           <span class="required-field"> *</span>
        </div>
        <div class="detail-admin-row">
            <span class="detail-admin-label">取得年月日 :</span>
            <asp:TextBox ID="txt_取得年月日" runat="server" onkeypress="return InputNumberKeys(this, event)"
                CssClass="css_font_textbox css_textbox_Calendar validation textbox width_calendar" MaxLength="8"/>
            <asp:ImageButton ID="ImageButton2" runat="server" CssClass="btn_calendar"  ImageUrl="~/Images/calendar.jpg" ValidationGroup="detailForm"/>
            <ajaxToolkit:CalendarExtender ID="CalendarExtender2" runat="server" PopupButtonID="ImageButton2" TargetControlID="txt_取得年月日" Format="yyyy/MM/dd"> </ajaxToolkit:CalendarExtender>    
            <asp:CustomValidator ID= "CustomValidator取得年月日" runat="server" 
                    ControlToValidate="txt_取得年月日" 
                    ClientValidationFunction= "CheckDate取得年月日"
                    ErrorMessage="2.0" 
                    Display ="None" 
                    SetFocusOnError="False" ValidateEmptyText="True" />
                <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender2"
                    TargetControlID="CustomValidator取得年月日" 
                    HighlightCssClass="invalid" Width="240px"
                    CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
                <asp:CustomValidator ID= "CustomValidator取得年月日1" runat="server" 
                    ControlToValidate="txt_取得年月日" 
                    ClientValidationFunction= "CheckIsDate取得年月日"
                    ErrorMessage="2.1" 
                    Display ="None" 
                    SetFocusOnError="False" ValidateEmptyText="True" />
                <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender11"
                    TargetControlID="CustomValidator取得年月日1" 
                    HighlightCssClass="invalid1" Width="210px"
                    CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
                <asp:CustomValidator ID= "CustomValidator取得年月日2" runat="server" 
                    ControlToValidate="txt_取得年月日" 
                    ClientValidationFunction= "CheckDate取得年月日2"
                    ErrorMessage="2.3" 
                    Display ="None" 
                    SetFocusOnError="False" ValidateEmptyText="True" />
                <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender4"
                    TargetControlID="CustomValidator取得年月日2" 
                    HighlightCssClass="invalid3" Width="240px"
                    CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png" />
                <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator取得年月日"
                    ControlToValidate="txt_取得年月日"
                    Display="None"
                    ErrorMessage="2.2" 
                    SetFocusOnError="False" />
                <ajaxToolkit:ValidatorCalloutExtender runat="Server" ID="ValidatorCalloutExtender17"
                        TargetControlID="RequiredFieldValidator取得年月日" 
                        HighlightCssClass="invalid2" Width="240px"
                        CssClass="CustomValidatorCalloutStyle" WarningIconImageUrl="../Images/warning.png"/>
           <span class="required-field"> *</span>
        </div>
 <br />
 <br />
	<div class="detail-admin-row">
		<span class="detail-admin-label">&nbsp;</span>
		<asp:Button ID="btn登録" runat="server" Text="登録" CssClass="btn" onclick="btn登録_Click" OnClientClick="javascript:focusToControlErr();"/>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<asp:Button ID="btnリセット" runat="server" Text="リセット" CssClass="btn" ValidationGroup="detailForm" onclick="btnリセット_Click" />
	</div>

 <br />
 <br />
        
<div class="content_grv">
	 <div class="grv_name"><span>※保有資格情報一覧</span></div>
	 <div class="Header4" style="height: 5px;color: buttonshadow;"></div>    
	<div id="div_保有資格情報一覧">
		<br style="clear: both" />
		<div class="fixpadding">
			<asp:Panel ID="pnlGridView" runat="server">
						<asp:GridView CssClass="mGrid" ID="grv_保有資格情報一覧" runat="server" AutoGenerateColumns="False"
							AllowPaging="true" PageSize="10" OnPageIndexChanging="grv_保有資格情報一覧_SelectedIndexChanging"
							PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt" 
							GridLines="Vertical" DataKeyNames="ID"
							Height="40px" Width="734px" OnRowCommand="grv_保有資格情報一覧_RowCommand" 
							OnRowDataBound="grv_保有資格情報一覧_RowDataBound" onprerender="grv_保有資格情報一覧_PreRender">
							<Columns>
								<asp:TemplateField HeaderText="資格免許">
									<ItemTemplate>
										<div style="width: 210px; overflow: hidden">
											<asp:Label ID="lbl_資格免許" runat="server" CssClass="css_font_textbox" Text='<%# Eval("資格免許名") %>'></asp:Label>
										</div>
									</ItemTemplate>
								</asp:TemplateField>
								<asp:TemplateField HeaderText="社内外区分" ItemStyle-HorizontalAlign="Center">
									<ItemTemplate>
										<div style="width: 70px; overflow: hidden">
											<asp:Label ID="lbl_社内外区分" runat="server" CssClass="css_font_textbox" Text='<%# ConvertType(Eval("社内外区分")) %>'></asp:Label>
										</div>
									</ItemTemplate>
								</asp:TemplateField>
								<asp:TemplateField HeaderText="受検年月日" ItemStyle-HorizontalAlign="Center">
									<ItemTemplate>
										<div style="width: 110px; overflow: hidden">
											<asp:Label ID="lbl_受検年月日" runat="server" CssClass="css_font_textbox" Text='<%# Bind("受検年月日", "{0:yyyy年MM月dd日}") %>'></asp:Label>
										</div>
									</ItemTemplate>
								</asp:TemplateField>
								<asp:TemplateField HeaderText="取得年月日" ItemStyle-HorizontalAlign="Center">
									<ItemTemplate>
										<div style="width: 110px; overflow: hidden">
											<asp:Label ID="lbl_取得年月日" runat="server" CssClass="css_font_textbox" Text='<%# Bind("取得年月日", "{0:yyyy年MM月dd日}") %>'></asp:Label>
										</div>
									</ItemTemplate>
								</asp:TemplateField>
								<asp:ButtonField Text="Button" DataTextField="ID" CommandName="LoadUpdate" Visible="true"
									HeaderStyle-CssClass="visible" ItemStyle-CssClass="visible" FooterStyle-CssClass="visible">
									<FooterStyle CssClass="visible" />
									<HeaderStyle CssClass="visible" />
									<ItemStyle CssClass="visible" />
								</asp:ButtonField>
								<%--<asp:ButtonField Text="Button" DataTextField="ID" CommandName="LoadUpdate" Visible="true" />--%>
							</Columns>
							<PagerSettings FirstPageText="最初" Mode="NumericFirstLast" PageButtonCount="5" LastPageText="最後" />
						</asp:GridView>
			</asp:Panel>
		</div>
	</div>
</div>
	 <div class="detail-admin-row">
		 <div class="btn_back">
			<asp:Button ID="btn_戻る"  runat="server" Text="←戻る" OnClick="btn_戻る_Click" ValidationGroup="detailForm" CssClass="btn"/>
		 </div>
		 <div class="btn_next">
			 <asp:Button ID="btn_次"  runat="server" Text="次→" OnClick="btn_次_Click" ValidationGroup="detailForm" CssClass="btn" />
		 </div>
	</div>
	<div>&nbsp;</div>
	<br /> 
</ContentTemplate>
</asp:UpdatePanel>
</div>
</asp:Content>


